<?php
$con = mysql_connect("localhost", "root", "");

if (!$con) 
{
    die("Error: " . mysql_error());
}

mysql_select_db("vijay", $con);

$result = mysql_query("SELECT * FROM new");
?>
<!DOCTYPE html>
<html>
    <head>
        <title>DataTables</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
        <script src="media/js/jquery.js" type="text/javascript"></script>
        <script src="media/js/jquery.dataTables.js" type="text/javascript"></script>
        
        <style type="text/css">
            @import "media/css/demo_table_jui.css";
            @import "media/themes/ui-lightness/jquery-ui-1.8.4.custom.css";
        </style>
        
        <style>
            *{
                font-family: arial;
            }
        </style>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function(){
                $('#datatables').dataTable({
                    "sPaginationType":"full_numbers",
                    "aaSorting":[[2, "desc"]],
                    "bJQueryUI":true
                });
            })
            
        </script>
        
    </head>
    <body>
     <div>
         <table id="datatables" class="display">
             <thead>
                 <tr>
                     <th>Id</th>
                     <th>First Name</th>
                     <th>Last Name</th>
                     <th>City</th>
                     <th>Address<br> Local</th>
                     <th>Mobile</th>
                     <th>Branch</th>
                 </tr>
             </thead>
             <tbody>
                 <?php
                 while ($row = mysql_fetch_array($result)) {
                     ?>
                     <tr>
                         <td><?php echo $row['newId']?></td>
                         <td><?php echo $row['firstName']?></td>
                         <td><?php echo $row['lastName']?></td>
                         <td><?php echo $row['city']?></td>
                         <td><?php echo $row['address']?></td>
                         <td><?php echo $row['mobile']?></td>
                         <td><?php echo $row['branch']?></td>
                     </tr>
                     <?php
                 }
                 ?>
             </tbody>
         </table>
     </div>
    </body>
</html>
